<!DOCTYPE html>
<HTML>
<HEAD><meta name="viewport" content="width=device-width, initial-scale=1">
<Title>DrawArea.linearGradientColor2</Title>
<link type='text/css' rel='Stylesheet' href="maxchartapi.css" />
</HEAD>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0">

<p class="heading0">ChartDirector 7.0 (Java Edition)</p>
<p class="heading1"><a href="DrawArea.htm">DrawArea</a>.<wbr>linearGradientColor2</p>
<hr class="separator">
<p class="heading2a">Usage</p>
<div class="content">
public int linearGradientColor2(int startX, int startY, int endX, int endY, int[] colorArray [, boolean periodic ])
</div>
<p class="heading2">Description</p>
<div class="content">
Creates a multi-point linear gradient color.<br><br>
The color stops are defined as an array of offsets and colors in the following format:<br><br>
<div class="indentedblock"><code>offset0, color0, offset1, color1, .... offsetN, colorN</code></div><br>
The first offset (offset0) should be 0. It represents the starting point of the gradient. The last offset (offsetN) can be any number not greater than 100000. It represents the ending point of the gradient. The other offsets represent the positions of the color stops in between.<br><br>
For example, the array (in hex):<br><br>
<div class="indentedblock"><code>000000, FF0000, 000080, FFFF00, 000100, 00FF00</code></div><br>
means the starting point (000000) is red (FF0000), the mid-point (000080 in hex) is yellow (FFFF00), and the ending point (000100 in hex) is green (00FF00).<br><br>
One common usage of multi-point gradient colors is to define colors that have metallic look and feel. ChartDirector comes from several predefined gradient color arrays as follows.<br><br>
<div style="width:100%;box-sizing:border-box;"><table width="100%" border="1" cellpadding="5" cellspacing="0"> <tr><th width="19%">Name<th>Value (in Hex) <tr><td><a href="Chart.goldGradient.htm">goldGradient</a><td> 000000, FFE743, 000060, FFFFE0, 0000B0, FFF0B0, 000100, FFE743 <tr><td><a href="Chart.silverGradient.htm">silverGradient</a><td> 000000, C8C8C8, 000060, F8F8F8, 0000B0, E0E0E0, 000100, C8C8C8 <tr><td><a href="Chart.redMetalGradient.htm">redMetalGradient</a><td> 000000, E09898, 000060, FFF0F0, 0000B0, F0D8D8, 000100, E09898 <tr><td><a href="Chart.greenMetalGradient.htm">greenMetalGradient</a><td> 000000, 98E098, 000060, F0FFF0, 0000B0, D8F0D8, 000100, 98E098 <tr><td><a href="Chart.blueMetalGradient.htm">blueMetalGradient</a><td> 000000, 9898E0, 000060, F0F0FF, 0000B0, D8D8F0, 000100, 9898E0 </table></div>
</div>
<p class="heading2">Arguments</p>
<div class="content">
<div style="width:100%;box-sizing:border-box;">
<table border="1" cellpadding="5" cellspacing="0" width="100%"> 
<tr>
<th width="19%">Argument</th><th width="19%">Default</th><th>Description</th>
</tr>
<tr>
<td>startX</td><td>(Mandatory)</td><td>The x coordinate of the starting point of the reference gradient line segment.</td></tr><tr><td>startY</td><td>(Mandatory)</td><td>The y coordinate of the starting point of the reference gradient line segment.</td></tr><tr><td>endX</td><td>(Mandatory)</td><td>The x coordinate of the ending point of the reference gradient line segment.</td></tr><tr><td>endY</td><td>(Mandatory)</td><td>The y coordinate of the ending point of the reference gradient line segment.</td></tr><tr><td>colorArray</td><td>(Mandatory)</td><td>An array defining the offsets and colors of the color stops along the gradient.</td></tr><tr><td>periodic</td><td>false</td><td>Specifies whether the gradient will repeat itself periodically. If the gradient does not repeat itself, the points that lie beyond the end points of the gradient line segment will assume the colors of the end points.</td>
</tr>
</table>
</div>
</div>
<p class="heading2">Return Value</p>
<div class="content">
A 32-bit integer representing the linear gradient color.
</div>
<br><hr class="separator">
<div class="copyright">&copy; 2022 Advanced Software Engineering Limited. All rights reserved.</div>
</body>
</HTML>
